package com.zh.familyInfo.service.impl;

import com.zh.common.utils.StringUtil;
import com.zh.familyInfo.dao.FamilyDao;
import com.zh.familyInfo.domain.FamilyDO;
import com.zh.familyInfo.service.FamilyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;
import java.util.Map;


@Service
public class FamilyServiceImpl implements FamilyService {
	@Autowired
	private FamilyDao familyDao;
	
	@Override
	public FamilyDO get(String id){
		return familyDao.get(id);
	}
	
	@Override
	public List<FamilyDO> list(Map<String, Object> map){
		return familyDao.list(map);
	}
	
	@Override
	public int count(Map<String, Object> map){
		return familyDao.count(map);
	}
	
	@Override
	public int save(FamilyDO family){
		family.setId(StringUtil.generalKeyword());
		family.setCreateDate(new Date());
		return familyDao.save(family);
	}
	
	@Override
	public int update(FamilyDO family){
		family.setUpdateDate(new Date());
		return familyDao.update(family);
	}
	
	@Override
	public int remove(String id){
		return familyDao.remove(id);
	}
	
	@Override
	public int batchRemove(String[] ids){
		return familyDao.batchRemove(ids);
	}

	@Override
	public List<FamilyDO> select(FamilyDO familyDO){return familyDao.select(familyDO);}
	
}
